oxenstored: fix error when shifting negative value
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 26 Apr 2016 10:07:51 +0000 (12:07 +0200)
committerWei Liu <wei.liu2@citrix.com>
Wed, 27 Apr 2016 13:14:18 +0000 (14:14 +0100)
commit92afa655e7b60a3c4d00fe1c7193e79fa4b901ad
treec829d8e4073b10a28b6f4a6fddf1e8abb0530ce0
parent31268fea286fc129cd3015cf9de39eaf816173e7
oxenstored: fix error when shifting negative value

By explicitly casting it to unsigned.

Reasoning on why this is needed, provided by Andrew Cooper:

"Ocaml stores integers shifted left by one, and with the bottom bit set.

Values with the bottom bit clear are pointers into the GC'd heap. Values
with the bottom bit set are integers, and need to be shifted by 1 bit to
have calculations performed."

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
tools/ocaml/xenstored/systemd_stubs.c